package Bird;

public class Eagle extends Bird 
{
   

   private FlyBahavior flyBehavior;
   private SwimBehavior swimBehavior;

   public Eagle(FlyBahavior fly, SwimBehavior swim)
   {
      System.out.println("老鹰");
      this.flyBehavior = fly;
      this.swimBehavior = swim;
   }

   @Override
   public void display() {
      this.flyBehavior.fly();
      this.swimBehavior.swim();
   }
}
